use serde::{Deserialize, Serialize};

/// 字典项数据模型
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DictItem {
    /// 字典编码
    pub dict_code: Option<i64>,
    /// 字典键值
    pub dict_key: String,
    /// 字典值
    pub dict_value: String,
    /// 字典标签
    pub dict_label: String,
    /// 字典类型
    pub dict_type: String,
    /// CSS类名（表格回显样式使用）
    pub css_class: Option<String>,
    /// 列表回显样式
    pub list_class: Option<String>,
    /// 是否默认（1是 0否）
    pub is_default: String,
    /// 状态（1正常 0停用）
    pub status: String,
    /// 排序号
    pub dict_sort: i32,
    /// 备注
    pub remark: Option<String>,
    /// 创建时间
    pub create_time: Option<String>,
    /// 更新时间
    pub update_time: Option<String>,
}

/// 字典类型数据模型
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DictType {
    /// 字典主键
    pub dict_id: Option<i64>,
    /// 字典名称
    pub dict_name: String,
    /// 字典类型
    pub dict_type: String,
    /// 状态（1正常 0停用）
    pub status: String,
    /// 备注
    pub remark: Option<String>,
    /// 创建时间
    pub create_time: Option<String>,
    /// 更新时间
    pub update_time: Option<String>,
}

impl Default for DictItem {
    fn default() -> Self {
        Self {
            dict_code: None,
            dict_key: String::new(),
            dict_value: String::new(),
            dict_label: String::new(),
            dict_type: String::new(),
            css_class: None,
            list_class: None,
            is_default: "0".to_string(),
            status: "1".to_string(),
            dict_sort: 0,
            remark: None,
            create_time: None,
            update_time: None,
        }
    }
}

impl Default for DictType {
    fn default() -> Self {
        Self {
            dict_id: None,
            dict_name: String::new(),
            dict_type: String::new(),
            status: "1".to_string(),
            remark: None,
            create_time: None,
            update_time: None,
        }
    }
} 